

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%@ include file="/WEB-INF/jsp/include/page_header.jspf" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>.: Pocket.my :.</title>        
        <script type="text/javascript">
            $(document).ready(function() {
                $('.myCorner').corner();                
            });
            
            function doView(id){
                form = document.forms.form1;
                form.action = 'advertisment?Step2&idAds=' + id;
                form.submit();
            }
            
        </script>
    </head>
    <body>
        <s:useActionBean beanclass="com.apps.epocket.stripes.util.ListUtil" var="list"/>
        <s:form beanclass="com.apps.epocket.stripes.WelcomeActionBean" id="form1">
            <div id="center" class="column">	  	

                <div id="content">	                    
                    <div class="">
                        <s:text name="textSearch" class="" size="30"/>&nbsp;
                        <s:select name="kategorySearch" class="">
                            <s:option value="*">All Categories</s:option>
                            <s:options-collection collection="${list.senaraiKategoriProduk}" label="kategoriKetergn" value="idKategoriProduk"/>
                        </s:select> &nbsp;
                        <s:select name="locationSearch" class="">
                            <s:option value="*">All Location</s:option>
                            <s:options-collection collection="${list.senaraiKodNegeri}" label="ketrgnNegeri" value="kodNegeri"/>
                        </s:select> &nbsp;
                        <s:submit name="search" value="Search"/>
                    </div>
                    <br/>
                    <br/>

                    <div class="stuff">
                        <c:if test="${empty actionBean.senaraiIklan}">                            
                            <img src="${pageContext.request.contextPath}/images/KnobCancel.png" alt=""/>No Ad(s) found!!
                        </c:if>
                        <c:if test="${!empty actionBean.senaraiIklan}">
                            <c:forEach items="${actionBean.senaraiIklan}" var="item" varStatus="line">

                                <div style="background-color: ${line.count %2 == 0 ?'':'lemonchiffon'}">
                                    <tr>
                                        <td>
                                            <table>
                                                <tr>
                                                    <td width="150px">
                                                        <font color="black"><fmt:formatDate value="${item.trhMasuk}" pattern="dd/MM/yyyy"/><br/>   
                                                        <fmt:formatDate value="${item.trhMasuk}" pattern="hh:mm:ss aaa"/>  </font> 
                                                    </td>
                                                    <td width="170px">
                                                        <c:if test="${!empty item.senaraiDokumenPengiklanan[0].idDokumenIklan}">
                                                        <img src="${pageContext.request.contextPath}/dokumen/view/${item.senaraiDokumenPengiklanan[0].idDokumenIklan}"
                                         alt="" width="150" height="100" />                                                          
                                                        </c:if>
                                                        <c:if test="${empty item.senaraiDokumenPengiklanan[0].idDokumenIklan}">
                                                            <img src="${pageContext.request.contextPath}/images/trade.png"
                                         alt="" width="150" height="100" /> 
                                                        </c:if>
                                                    </td>
                                                    <td width="150px">
                                                        <font color="black"><a href="#" onclick="doView('${item.idIklan}');" class="aRef">${item.namaIklan}</a><br/>
                                                            RM <fmt:formatNumber value="${item.hargaIklan}" pattern="#,###.00"/></font>
                                                    </td>
                                                    <td width="150px">
                                                        <font color="black">${item.kategoriProduk.kategoriKetergn}</font>
                                                    </td>
                                                    <td width="150px">
                                                        <font color="black">${item.negeriIklan.ketrgnNegeri}</font>
                                                    </td>
                                                </tr>

                                            </table>
                                        </td>
                                    </tr>                                  
                                </div>                                
                            </c:forEach> 

                        </c:if>
                    </div>
                </div>
            </div>
        </s:form>
    </body>
</html>
